package com.gitee.aurora.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 类描述: 解决swagger静态资源访问404问题
 *
 * @author wanghongchao
 * @version 1.0
 * @date 2019/09/18 17:34
 */
@Configuration
public class SwaggerMvcConfig implements WebMvcConfigurer {
    /**
     *
     * 功能描述: 解决swagger静态资源访问404问题
     *
     * @param registry 静态资源注册类
     * @author zzh
     * @date 2022/9/19 9:51
     */
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("swagger-ui.html")
                .addResourceLocations("classpath:/META-INF/resources/");
        registry.addResourceHandler("/webjars/**")
                .addResourceLocations("classpath:/META-INF/resources/webjars/");
    }
}
